// Pixel shader combines the bloom image with the original
// scene, using tweakable intensity levels and saturation.
// This is the final step in applying a bloom postprocess.

sampler baseSampler : register(s0);
sampler lastSampler : register(s1);

////////////////////////////////////////////////////////
// Suma
////////////////////////////////////////////////////////

float4 SUMPS(float2 texCoord : TEXCOORD0) : COLOR0
{
    // Look up the bloom and original base image colors.
    float4 base = tex2D(baseSampler, texCoord);
    float4 last = tex2D(lastSampler, texCoord);
    
    // Combine the two images.
    return base + last;
}


technique SUM
{
    pass Pass1
    {
        PixelShader = compile ps_2_0 SUMPS();
    }
}

////////////////////////////////////////////////////////
// Para sobel
////////////////////////////////////////////////////////

float4 SobelPS(float2 texCoord : TEXCOORD0) : COLOR0
{
    // Look up the bloom and original base image colors.
    float4 base = tex2D(baseSampler, texCoord);
    float4 last = tex2D(lastSampler, texCoord);
    
    if(last.r == 0 && last.g == 0 && last.b == 0)
		return last;
	else
		return base;
}


technique SobelCombine
{
    pass Pass1
    {
        PixelShader = compile ps_2_0 SobelPS();
    }
}
